{include file='pub/header'/}
<title>活动类型</title>
</head>
<body>
<div class="page-container">
    <form class="form form-horizontal" id="open_time" method="post" enctype="multipart/form-data">
        <input type="hidden" name="id" value="{$item.id}">
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">商品名称：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" value="{$item.name}" disabled>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">开始时间：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" value="{$item.start_time}" name="start_time" onfocus="date_h()" id="datemin1" required>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">结束时间：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" value="{$item.end_time}" name="end_time" onfocus="date_h1()" id="datemax1" required>
            </div>
        </div>
        <div class="row cl">
            <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
                <button class="btn btn-secondary radius" type="submit"><i class="Hui-iconfont">&#xe632;</i> 确定
                </button>
            </div>
        </div>
    </form>
</div>


{include file="pub/footer"/}
<script type="text/javascript">
    function date_h() {
        WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',maxDate:'#F{ $dp.$D(datemax1)}'})
    }
    function date_h1() {
        WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',minDate:'#F{ $dp.$D(datemin1)}'})
    }
    $(function () {
        $("#open_time").validate({
            submitHandler: function (form) {
                $(form).ajaxSubmit({
                    type: 'post',
                    url: '{:url("Products/sec_active_edit")}',
                    success: function (res) {
                        if (1 == res.code) {
                            layer.msg(res.msg, {icon: 6, time: 1000});
                            setTimeout(function () {
                                parent.location.reload();
                            }, 888);
                        } else {
                            layer.msg(res.msg, {icon: 5, time: 1000});
                        }
                    }
                });

            }
        });
    });
</script>
</body>
</html>